package com.vhall.component.controller.data;

import com.vhall.component.entity.data.dto.ViewingRecordsDTO;
import com.vhall.component.entity.data.vo.SelectedVideoReqVO;
import com.vhall.component.entity.data.vo.SelectedVideoRspVO;
import com.vhall.component.entity.page.vo.PageVO;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.service.data.PersonalCenterService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 个人中心
 * PersonalCenterController
 * - 直播预约分页
 * - 观看记录分页
 *
 * @author xing.wang
 * @date 2023/10/17
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/v4/data/personal-center")
public class PersonalCenterController {
    private final PersonalCenterService personalCenterService;

    /**
     * 直播预约
     *
     * @param reqVO
     * @return
     */
    @TokenAuth
    @PostMapping("/live-booking")
    public PageVO<SelectedVideoRspVO> liveBooking(@Validated SelectedVideoReqVO reqVO) {
        return personalCenterService.liveBooking(reqVO);
    }

    /**
     * 观看记录
     *
     * @param reqVO
     * @return
     */
    @TokenAuth
    @PostMapping("/viewing-records")
    public PageVO<ViewingRecordsDTO> viewingRecords(@Validated SelectedVideoReqVO reqVO) {
        return personalCenterService.viewingRecords(reqVO);
    }
}
